package com.easywork.mystery.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.easycore.utils.BaseController;
import com.easywork.mystery.es.EsPoetry;
import com.easywork.mystery.service.EsPoetryService;
import com.easywork.mystery.service.PoetryService;

@Controller
@RequestMapping("/mona/Poetry")
public class EsPoetryController extends BaseController {

	@Autowired
	private PoetryService poetryService;
	@Autowired
	private EsPoetryService esPoetryService;

	@RequestMapping("/find")
	@ResponseBody
	public List<EsPoetry> findByContent(String content) {
		System.out.println("content =" + content);
		return esPoetryService.findByContent(content);
	}

	// --导入到esPoetry
	@RequestMapping("/init")
	public String initData() {
		poetryService.initData();
		return "/demo/success";
	}
}